<template>
	<view class="wallet">
		<view class="wallet-info">
			<view class="wallet-info-tit">账户余额（元）</view>
			<view class="wallet-info-money">
				<view class="wallet-info-money-left">{{walletInfo.money}}</view>
				<!-- <view class="wallet-info-money-right">
					<view>待到账（元）</view>
					<text>{{walletInfo.wait_money?walletInfo.wait_money:0}}</text>
				</view> -->
			</view>
		</view>
		<view class="wallet-cell">
			<!-- <view class="wallet-cell-box">
				<navigator class="navigator" url="/pages/my/withdraw/withdraw">提现<view><image src="https://master.shengejiaju.cn/web/static/icons/ico_more_goods@2x.png"></image></view></navigator>
			</view> -->
			<view class="wallet-cell-box">
				<navigator class="navigator" url="/pages/my/details/details">明细<view><image src="https://master.shengejiaju.cn/web/static/icons/ico_more_goods@2x.png"></image></view></navigator>
			</view>
			<!-- <view class="wallet-cell-box">
				<navigator class="navigator" :url="'/pages/my/bind-alipay/bind-alipay-form?alipay_sn='+walletInfo.alipay_sn+'&real_name='+walletInfo.real_name">绑定支付宝<view>{{walletInfo.alipay_sn?'已绑定':'未绑定'}}<image src="https://master.shengejiaju.cn/web/static/icons/ico_more_goods@2x.png"></image></view></navigator>
			</view> -->
			<view class="wallet-cell-box customJump" @click="goWithdrawPassword">
				支付密码
				<view>
					{{walletInfo.privat_key?'已设置':'未设置'}}
					<image src="https://master.shengejiaju.cn/web/static/icons/ico_more_goods@2x.png"></image>
				</view>
			</view>
		</view>
		<!-- <view class="wallet-cell-tips">
			<view class="wallet-cell-tips-tit">提现说明：</view>
			<view class="wallet-cell-tips-text">1.首次提现需先绑定支付宝账号，设置提现密码后才能提现。</view>
			<view class="wallet-cell-tips-text">2.申请提现后需审核1-7个工作日，审核通过后才打款，审核期间账户余额会根据提现金额的多少变动，提现待审核金额在账户余额旁边有显示。</view>
			<view class="wallet-cell-tips-text">3.提现进度可在“提现-提现历史”里查看提现状态。</view>
			<view class="wallet-cell-tips-text">4.未提现的收益不会清零，会累计到账户余额，下次再提现。</view>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				walletInfo: {}
			};
		},
		onShow() {
			this.init()
		},
		methods: {
			init(){
				this.$api.MyWallet().then(res => {
					this.walletInfo = res.datas
				})
			},
			goWithdrawPassword(){
				if(!this.walletInfo.privat_key){
					uni.navigateTo({
						url: '/pages/my/withdraw-password/verify-phone'
					})
				}else{
					uni.showModal({
						title: '温馨提示',
						content: '您已设置提现密码，是否忘记了提现密码？',
						confirmText: "忘记密码",
						success(resConfirm) {
							if(resConfirm.confirm){
								uni.navigateTo({
									url: '/pages/my/forgot-withdraw-password/forgot-withdraw-password'
								})
							}
						}
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	.wallet{
		.wallet-info{
			padding: 45rpx 20rpx;
			background-color: #2073f5;
			color: #FFF;
			.wallet-info-tit{
				font-size: 28rpx;
				margin-bottom: 50rpx;
			}
			.wallet-info-money{
				display: flex;
				align-items: center;
				justify-content: space-between;
				.wallet-info-money-left{
					font-size: 80rpx;
				}
				.wallet-info-money-right{
					text-align: center;
					view{
						font-size: 24rpx;
						margin-bottom: 10rpx;
					}
					text{
						font-size: 34rpx;
					}
				}
			}
		}
		.wallet-cell{
			margin-top: 20rpx;
			.wallet-cell-box{
				border-bottom: solid 1px #EEE;
				&.customJump,
				.navigator{
					display: flex;
					background-color: #FFF;
					justify-content: space-between;
					align-items: center;
					padding: 40rpx 20rpx;
					font-size: 32rpx;
					image{
						width: 12rpx;
						height: 20rpx;
						vertical-align: middle;
						margin-left: 10rpx;
					}
					view{
						font-size: 28rpx;
						color: #FE9B26;
					}
				}
			}
		}
		.wallet-cell-tips{
			padding: 20rpx;
			.wallet-cell-tips-tit{
				font-weight: bold;
				margin-bottom: 20rpx;
				font-size: 28rpx;
			}
			.wallet-cell-tips-text{
				font-size: 26rpx;
				color: #666;
				line-height: 56rpx;
			}
		}
	}
</style>